<ul id="<?php echo $this->config->item('site_accr'); ?>_top_menu">
	<?php

	$iTopMenu = $qTopMenu->num_rows();
	
	for ($i = 0; $i < $iTopMenu; $i++)
	{
		$sLiClass = 'top_menu_item';
		
		
		if ($i === 0)
		{
			$sLiClass = $sLiClass.' '.$sLiClass.'_start';
		} 
		else if ($i === ($iTopMenu - 1))
		{
			$sLiClass = $sLiClass.' '.$sLiClass.'_end';
		}
		
		if ($qTopMenu->row($i)->page_id === $this->iTopLevelSelectedPageId)
		{
			$sLiClass .= ' top_menu_item_selected';
		}

		$sHref = '/'.$qTopMenu->row($i)->lang_accr.'/'.$qTopMenu->row($i)->page_name;

		if ($qTopMenu->row($i)->page_name === null)
		{
			$sHref = '/';
		}
		
		if ($sHref === '//')
		{
			$sHref = '/';
		}
		
		$bExt = false;
		
		if ($qTopMenu->row($i)->ext_url !== null)
		{
			$sHref = $qTopMenu->row($i)->ext_url;
			$bExt = true;
		}

		?>
		<li class="<?php echo $sLiClass; ?>">
			<a href="<?php echo $sHref; ?>"<?php if ($bExt === true) { echo ' rel="external"'; } ?>><?php echo $qTopMenu->row($i)->page_menu_title; ?></a>
			
			<?php
			
			if ($i === 0)
			{
				?>
				<ul>
					<li class="top_sub_menu_item">
						<a href="#">Test 1</a>
						
						<ul>
							<li class="top_sub_menu_item">
								<a href="#">Test 1.1</a>
								
								<ul>
									<li class="top_sub_menu_item">
										<a href="#">Test 1.1.1</a>

										<ul>
											<li class="top_sub_menu_item">
												<a href="#">Test 1.1.1.1</a>

												<ul>
													<li class="top_sub_menu_item">
														<a href="#">Test 1.1.1.1</a>
													</li>
													<li class="top_sub_menu_item">
														<a href="#">Test 1.1.1.2</a>
													</li>
													<li class="top_sub_menu_item">
														<a href="#">Test 1.1.1.3</a>
													</li>
													<li class="top_sub_menu_item">
														<a href="#">Test 1.1.1.4</a>
													</li>
												</ul>	
												
											</li>
											<li class="top_sub_menu_item">
												<a href="#">Test 1.1.1.2</a>
											</li>
											<li class="top_sub_menu_item">
												<a href="#">Test 1.1.1.3</a>
											</li>
											<li class="top_sub_menu_item">
												<a href="#">Test 1.1.1.4</a>
											</li>
										</ul>										
									</li>
									<li class="top_sub_menu_item">
										<a href="#">Test 1.1.2</a>
									</li>
									<li class="top_sub_menu_item">
										<a href="#">Test 1.1.3</a>
									</li>
									<li class="top_sub_menu_item">
										<a href="#">Test 1.1.4</a>
									</li>
								</ul>
							</li>
							<li class="top_sub_menu_item">
								<a href="#">Test 1.2</a>
							</li>
							<li class="top_sub_menu_item">
								<a href="#">Test 1.3</a>
							</li>
							<li class="top_sub_menu_item">
								<a href="#">Test 1.4</a>
							</li>
						</ul>					
						
					</li>
					<li class="top_sub_menu_item">
						<a href="#">Test 2</a>
					</li>
					<li class="top_sub_menu_item">
						<a href="#">Test 3</a>
					</li>
					<li class="top_sub_menu_item">
						<a href="#">Test 4</a>
					</li>
				</ul>
				<?php
			
			}
			
			?>
		</li>
		<li class="top_menu_spacer">|</li>
		<?php
	}

	?>
</ul>
<div class="<?php echo $this->config->item('site_accr'); ?>_clear"></div>
